<div class="list-client">

    <div class="button-new">
        <?php
        echo CHtml::link('<i class="icon-white icon-plus-sign"></i> '.Yii::t('app', 'Add ship task'), array('tracking/add'), array('class' => 'btn btn-success'));
        ?>
    </div>
    <div id="ajaxmessagetxt">
        <?php
        $flashMessages = Yii::app()->user->getFlashes();
        if ($flashMessages) {
            foreach($flashMessages as $key => $message) {
                echo '<div class="alert alert-' . $key . ' fade in"><button type="button" class="close" data-dismiss="alert">×</button>' . $message . "</div>\n";
            }
        }
        ?>
    </div>

    <?php
    //    $this->widget('zii.widgets.grid.CGridView', array(
    $this->widget('bootstrap.widgets.TbGridView', array(
        'id'=> 'tracking',
        'dataProvider'=>$model->search(),
//        'filter' => $model,
        'enableSorting' => false,
        'type' => 'striped',
        'columns'=>array(
            'id_tracking',
            array(
                'name' => 'id_client',
                'value'=> 'Common::getValue($data->id_client, Client::getListClient())',
            ),
            array(
                'name' => 'status',
                'value'=> 'Common::getStatusShip($data->status)',
            ),
            array(
                'name' => 'ship_date',
                'value'=> 'Common::formatDate($data->ship_date)',
            ),
            array(
                'name' => 'id_tpdetail',
                'value'=> 'Common::getValue($data->id_tpdetail, TransporterDetail::getListTransporter())',
            ),
            array(
                'name' => 'signature',
                'value'=> 'CHtml::image(Yii::app()->getBaseUrl()."/signature/".$data->id_tracking.".png", "", array("class"=>"img-grid"))',
                'type' => 'raw',
            ),

            array(
                'name' => 'track_task.id_by_matter',
                'value'=> 'TrackingTask::getListMatterTask($data->id_tracking)',
                'type' => 'raw',
            ),

            array(
                'class'=>'bootstrap.widgets.TbButtonColumn',
                'template' => '{view} {update} {delete}',
                'htmlOptions' => array('align'=>'center'),
                'afterDelete'=>'function(link,success,data){ if(success) $("#ajaxmessagetxt").html(data); }',
            ),
        ),
    ));
    ?>
</div>